using System;
using Crainiate.Data.Persistence;

namespace Crainiate.Data.Persistence.Modelling.Entities
{
    [AttributeUsage(AttributeTargets.Property)]
    public class ParentKeyAttribute : ColumnAttribute, ICompoundKeyColumnAttribute, IForeignKeyColumnAttribute
    {
        private Type _references;

        public ParentKeyAttribute(Type references)
        {
            _references = references;
        }

        public int Rank
        {
            get
            {
                return 0;
            }
        }

        public Type References
        {
            get
            {
                return _references;
            }
        }
    }

    [AttributeUsage(AttributeTargets.Property)]
    public class ChildKeyAttribute : ColumnAttribute, ICompoundKeyColumnAttribute, IForeignKeyColumnAttribute
    {
        private Type _references;

        public ChildKeyAttribute(Type references)
        {
            _references = references;
        }

        public int Rank
        {
            get
            {
                return 1;
            }
        }

        public Type References
        {
            get
            {
                return _references;
            }
        }
    }
}
